﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zocono.WCS.Domain.PlcBytesObject
{
    public class PlanarPutBatteryWcsActionBO : BytesObjectBase
    {
        /// <summary>
        /// 请求读取电池条码握手
        /// </summary>
        public short ActionType { get; set; }
        /// <summary>
        /// 目标位置编号
        /// </summary>
        public int ToEquipmentCode { get; set; }
        public int TaskCode { get; set; }
        public override void Serialize(long plcConnectionID, long plcReadDbID, int bytesIndex, int bytesLength, int objectIndex, int objectLength, string objectType, string ScEquipmentCode, byte[] bytes)
        {

            PlcConnectionID = plcConnectionID;
            PlcReadDbID = plcReadDbID;
            BytesIndex = bytesIndex;
            BytesLength = bytesLength;
            ObjectIndex = objectIndex;
            ObjectLength = objectLength;
            ObjectType = objectType;

            EquipmentCode = HelperByte.GetDIntAt(bytes, 0).ToString();
            ActionType = HelperByte.GetIntAt(bytes, 4);
            ToEquipmentCode = HelperByte.GetDIntAt(bytes, 6);
            TaskCode = HelperByte.GetDIntAt(bytes, 10);
        }
    }
}
